<?php
/**
 * +----------------------------------------------------------------------
 * | summer framework
 * +----------------------------------------------------------------------
 * | Copyright (c) 2020 https://github.com/suframe/think-admin All rights reserved.
 * +----------------------------------------------------------------------
 * | Author: summer <806115620@qq.com>  2020/3/30 14:30
 * +----------------------------------------------------------------------
 */
declare (strict_types = 1);

namespace app\mall\model\traits;

use app\mall\model\MallAct;
use think\Model;
use think\model\relation\BelongsTo;

/**
 * 获取活动
 * trait ActTrait
 * @package app\mall\model\traits
 * @mixin Model
 * @property integer $act_id
 */
trait ActTrait
{

    /**
     * 获取活动
     * @return BelongsTo
     */
    public function cate(): BelongsTo
    {
        return $this->belongsTo(MallAct::class, 'act_id', 'id')->cache('modelBelongsCate' .$this->act_id, 60);
    }

}